Skip to content

feat: add reusable EmptyState component and adopt across pages#2017

Open
elizabetdev wants to merge 9 commits intomainfrom
feat/empty-state-component
Open

feat: add reusable EmptyState component and adopt across pages#2017
elizabetdev wants to merge 9 commits intomainfrom
feat/empty-state-component

Conversation

@elizabetdev
Copy link
Copy Markdown
Contributor

@elizabetdev elizabetdev commented Mar 31, 2026

Summary

  • Add a new reusable EmptyState component with two variants (default for full-page states, card for inline/bordered states), optional icon, title, description, and action slot via children
  • Replace ad-hoc inline empty states across Alerts, Dashboards, Saved Searches, Search, Service Map, Sessions, and Chart Editor pages with the new component
  • Add EmptyState usage guidelines to agent_docs/code_style.md
  • Fix vertical centering and layout consistency (use height: 100% instead of 100vh for pages inside the nav layout)

Screenshots

alerts-new search-new service-map-new sessions-new Chart-Explorer-ClickStack-03-30-2026_06_17_PM Dashboards-ClickStack-03-31-2026_02_23_PM Saved-Searches-ClickStack-03-31-2026_02_29_PM

Test plan

  • Visit each page with no data and verify the empty state renders correctly:
    • Alerts page (no alerts created)
    • Dashboards page (no dashboards)
    • Saved Searches page (no saved searches)
    • Search page (no source selected)
    • Service Map page (no trace sources)
    • Sessions page (no session source)
    • Chart Editor (no query configured)
  • Verify empty states are horizontally centered and visually consistent
  • Verify pages with data still render normally (no regression)
  • Verify action buttons in empty states (e.g. New Dashboard, Go to Team Settings) still work

Extract repeated empty/setup state UI pattern into a shared EmptyState
component and adopt it in DBSearchPage and SessionsPage.

Made-with: Cursor
Replace ad-hoc inline empty states with the reusable EmptyState component
on Alerts, Dashboards, Search, Service Map, Sessions, and Chart Editor
pages. Extend EmptyState to support card/default variants, PaperProps,
BoxProps, and fullWidth option.

Made-with: Cursor
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hyperdx-oss Ready Ready Preview, Comment Mar 31, 2026 2:10pm

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 31, 2026

🦋 Changeset detected

Latest commit: af48c6a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@hyperdx/app Patch
@hyperdx/api Patch
@hyperdx/otel-collector Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 31, 2026

Knip - Unused Code Analysis

⚪ No changes detected (0 issues on both main and PR)

What is this?

Knip finds unused files, dependencies, and exports in your codebase.
This comment compares the PR branch against main to detect regressions.

Run yarn knip locally to see full details.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 31, 2026

PR Review

✅ No critical issues found.

The PR is a clean, well-structured refactoring that introduces a reusable EmptyState component and consistently adopts it across 7 pages. Code follows project patterns (Mantine UI, custom Button variants, proper imports).

A few minor observations:

  • ⚠️ Type casts in EmptyState.tsx (restProps as Omit<PaperProps, 'children'> / as Omit<BoxProps, 'children'>) are technically unsafe but unavoidable due to TypeScript's limitation with discriminated union destructuring. Acceptable here since runtime behavior is correct.
  • ℹ️ Behavior change in AlertsPage: The "Alerts can be created from..." info banner is now hidden when there are no alerts (it was previously always shown). The same info is now in the EmptyState description instead. Intentional, but worth confirming.
  • ℹ️ Divider removed from SessionSetupInstructions — minor visual regression between the header and stepper sections. Likely fine, but worth a visual check.
  • ℹ️ maw={600} in DBServiceMapPage is redundant — EmptyState already applies maw={600} to internal Title and Text elements. No functional impact.

The container was unintentionally narrowed to 600px for all states.
Now only the empty state uses the narrow centered layout while the
populated alert list keeps the original wide container.

Made-with: Cursor
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 31, 2026

E2E Test Results

2 tests failed • 115 passed • 3 skipped • 1087s

Status Count
✅ Passed 115
❌ Failed 2
⚠️ Flaky 1
⏭️ Skipped 3

Tests ran across 4 shards in parallel.

View full report →

Always apply mx="auto" on default variant instead of conditionally
based on maw presence. Remove fragile <br /> from SessionsPage
description — natural wrapping via maw is sufficient.

Made-with: Cursor
Replace ad-hoc inline empty states with EmptyState component on Saved
Searches and Dashboards list pages. Add vertical centering for empty
states using flex layout. Use minHeight instead of height on Dashboards
to prevent squishing when content exists.

Made-with: Cursor
The title prop has no default value — update agent_docs to match.

Made-with: Cursor
The app-content-scroll-container is already viewport-sized with
overflowY: scroll. Using 100vh on child pages caused double scrollbars.
100% correctly fills the parent scroll container.

Made-with: Cursor
@elizabetdev elizabetdev changed the title feat: adopt EmptyState component across pages feat: add reusable EmptyState component and adopt across pages Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant